import java.util.Arrays;


public class Trigram 
{
    
  

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + Arrays.hashCode(trigramArr);
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	Trigram other = (Trigram) obj;
	if (!Arrays.equals(trigramArr, other.trigramArr))
	    return false;
	return true;
    }

    private String[] trigramArr;
    
    private Trigram(String pos1, String pos2, String pos3)
    {
	trigramArr= new String[3];
	this.trigramArr[0] = pos1;
	this.trigramArr[1] = pos2;
	this.trigramArr[2] = pos3;
    }
    
    public static Trigram newTrigram(String pos1, String pos2, String pos3)
    {
	Trigram newTrigram = new Trigram(pos1, pos2, pos3);
	return newTrigram;
    }
    
    public String getPOS1()
    {
	return trigramArr[0];
    }
    
    public String getPOS2()
    {
	return trigramArr[1];
    }
    
    public String getPOS3()
    {
	return trigramArr[2];
    }
    
    public String[] getTrigram()
    {
	
	return this.trigramArr;
    }
    
    public String toString()
    {
	String output = "POS 1 is: " + getPOS1() + " POS 2 is: " + getPOS2() + " POS 3 is: " 
	+ getPOS3();
	return output;
    }

}
